<script setup lang="ts">
function onJoinClassClick() {
  uni.navigateTo({
    url: '/pages-sub/admin/class/join-class',
  })
}

function onCreateClassClick() {
  uni.navigateTo({
    url: '/pages-sub/admin/class/create-class',
  })
}
</script>

<template>
  <div class="page-container">
    <div class="header">
      <div class="icon-group">
        <div class="user-icon" />
        <div class="user-icon second-icon" />
      </div>
      <p class="no-class-text">
        您还没有加入任何班级
      </p>
    </div>

    <div class="button-section">
      <button class="action-btn join-class-btn" @click="onJoinClassClick()">
        加入班级
      </button>
      <button class="action-btn create-class-btn" @click="onCreateClassClick()">
        创建班级
      </button>
    </div>

    <div class="footer">
      <h2 class="feature-title">
        <span class="title-bar" />
        班级功能介绍
      </h2>
      <p class="feature-description">
        班级主要用于老师布置阅读配音作业，多人组团打卡或同学之间同步学习等场景。
      </p>
    </div>
  </div>
</template>

<style scoped lang="scss">
.page-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 顶部对齐 */
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
}

.header {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 50px;
  width: 100%;
  max-width: 400px;
}

.icon-group {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
}

.user-icon {
  position: absolute;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: #e0e0e0;
  border: 4px solid #f4f5f9;
  box-sizing: border-box;
}

.user-icon:first-child {
  left: 0;
  top: 10px;
  z-index: 2;
}

.user-icon.second-icon {
  right: 0;
  bottom: 10px;
  z-index: 1;
}

.no-class-text {
  font-size: 16px;
  color: #888;
  margin: 0;
}

.button-section {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 50px;
}

.action-btn {
  width: 100%;
  padding: 5px 0;
  border: none;
  border-radius: 30px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  transition:
    transform 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
  font-weight: bold;
  background: linear-gradient(to right, #4a90e2, #50e3c2);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.footer {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.feature-title {
  font-size: 18px;
  color: #333;
  margin-top: 0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.title-bar {
  width: 4px;
  height: 18px;
  background-color: #4a90e2;
  margin-right: 10px;
  border-radius: 2px;
}

.feature-description {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

.vip-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.vip-number {
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background-color: #4a90e2;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  flex-shrink: 0;
}

.vip-text {
  font-size: 14px;
  color: #333;
  margin: 0;
}
</style>
